UNPKG

pulse-dashboard

Version:

A Next.js Dashboard application for real-time monitoring and historical analysis of Playwright test executions. This component provides the UI for visualizing Playwright test results and can be run as a standalone CLI tool.

1 lines 24.5 kB
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[847],{25927:(e,s,t)=>{Promise.resolve().then(t.bind(t,73033))},73033:(e,s,t)=>{"use strict";t.d(s,{TestDetailsClientPage:()=>ea});var a=t(95155),r=t(35695),l=t(7323),n=t(66695),i=t(30285),d=t(12115),c=t(60704),o=t(59434);let h=c.bL,m=d.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(c.B8,{ref:s,className:(0,o.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...r})});m.displayName=c.B8.displayName;let u=d.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(c.l9,{ref:s,className:(0,o.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...r})});u.displayName=c.l9.displayName;let x=d.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(c.UC,{ref:s,className:(0,o.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r})});x.displayName=c.UC.displayName;var p=t(68856),j=t(55365),f=t(66424),g=t(58127),N=t(24371),v=t(11133),b=t(37648),w=t(50594),y=t(97990),A=t(15300),k=t(52333),T=t(60679),F=t(2448),S=t(12543),L=t(79311),D=t(13768),C=t(65064),E=t(68718),M=t(7270),O=t(58527),_=t(66766),R=t(26126),P=t(10549),z=t(48155);function H(e){let{status:s}=e;switch("string"==typeof s?s.toLowerCase():""){case"passed":return(0,a.jsx)(g.A,{className:"h-4 w-4 text-green-500 flex-shrink-0"});case"failed":return(0,a.jsx)(N.A,{className:"h-4 w-4 text-destructive flex-shrink-0"});case"skipped":return(0,a.jsx)(v.A,{className:"h-4 w-4 text-accent flex-shrink-0"});case"timedout":return(0,a.jsx)(b.A,{className:"h-4 w-4 text-destructive flex-shrink-0"});case"pending":return(0,a.jsx)(b.A,{className:"h-4 w-4 text-primary animate-pulse flex-shrink-0"});default:return(0,a.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})}}function I(e){var s;let{step:t,level:r=0}=e,l=t.steps&&t.steps.length>0,n=(0,a.jsxs)("div",{className:"flex flex-col space-y-2 ".concat(r>0?"pl-4 border-l border-muted ml-2":""),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between space-x-2",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 min-w-0",children:[(0,a.jsx)(H,{status:t.status}),(0,a.jsx)("span",{className:"text-sm font-medium text-foreground truncate",title:t.title,children:t.title}),t.isHook&&(0,a.jsx)(R.E,{variant:"outline",className:"text-xs px-1.5 py-0.5",children:t.hookType||"hook"})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:(s=t.duration)<1e3?"".concat(s,"ms"):"".concat((s/1e3).toFixed(2),"s")})]}),t.codeLocation&&(0,a.jsxs)("div",{className:"flex items-center text-xs text-muted-foreground space-x-1 pl-6",children:[(0,a.jsx)(z.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:t.codeLocation})]}),t.errorMessage&&(0,a.jsxs)("div",{className:"pl-6 mt-1",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-destructive mb-0.5",children:"Error:"}),(0,a.jsx)("pre",{className:"bg-destructive/10 text-xs p-2 rounded-md whitespace-pre-wrap break-all font-code max-h-32 overflow-y-auto",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,o.c)(t.errorMessage)}})})]})]});return l?(0,a.jsx)(P.nD,{type:"single",collapsible:!0,className:"w-full py-1",children:(0,a.jsxs)(P.As,{value:"step-".concat(t.id),className:"border-none",children:[(0,a.jsx)(P.$m,{className:"p-1 hover:no-underline hover:bg-muted/50 rounded-md text-left [&[data-state=open]>svg]:rotate-90",children:n}),(0,a.jsx)(P.ub,{className:"pt-0 pb-0",children:(0,a.jsx)("div",{className:"mt-1",children:t.steps.map(e=>(0,a.jsx)(I,{step:e,level:r+1},e.id))})})]})}):(0,a.jsx)("div",{className:"py-2 px-1 hover:bg-muted/50 rounded-md",children:n})}var V=t(34477);let B=(0,V.createServerReference)("0011e9424474535028c01a45dc1bf60dfbb2f5cfe3",V.callServer,void 0,V.findSourceMapURL,"getRawHistoricalReports");var W=t(83540),X=t(93504),$=t(94754),U=t(96025),Z=t(16238),J=t(94517),K=t(24026),q=t(21374);let G=e=>{let{cx:s,cy:t,payload:r}=e;if(!s||!t||!r)return null;let l="hsl(var(--muted-foreground))";return"passed"===r.status?l="hsl(var(--chart-3))":"failed"===r.status||"timedOut"===r.status?l="hsl(var(--destructive))":"skipped"===r.status&&(l="hsl(var(--accent))"),(0,a.jsx)("circle",{cx:s,cy:t,r:5,fill:l,stroke:"hsl(var(--card))",strokeWidth:1})},Q=e=>{let{active:s,payload:t,label:r}=e;if(s&&t&&t.length){let e=t[0].payload;return(0,a.jsxs)("div",{className:"bg-card p-3 border border-border rounded-md shadow-lg",children:[(0,a.jsx)("p",{className:"label text-sm font-semibold text-foreground",children:"Date: ".concat(new Date(e.date).toLocaleDateString())}),(0,a.jsx)("p",{className:"text-xs text-foreground",children:"Duration: ".concat(ee(e.duration))}),(0,a.jsx)("p",{className:"text-xs",style:{color:"passed"===e.status?"hsl(var(--chart-3))":"failed"===e.status||"timedOut"===e.status?"hsl(var(--destructive))":"hsl(var(--accent))"},children:"Status: ".concat(e.status)})]})}return null};function Y(e){let{status:s}=e;switch(s){case"passed":return(0,a.jsx)(g.A,{className:"h-6 w-6 text-[hsl(var(--chart-3))]"});case"failed":return(0,a.jsx)(N.A,{className:"h-6 w-6 text-destructive"});case"skipped":return(0,a.jsx)(v.A,{className:"h-6 w-6 text-[hsl(var(--accent))]"});case"timedOut":return(0,a.jsx)(b.A,{className:"h-6 w-6 text-destructive"});case"pending":return(0,a.jsx)(b.A,{className:"h-6 w-6 text-primary animate-pulse"});default:return(0,a.jsx)(w.A,{className:"h-6 w-6 text-muted-foreground"})}}function ee(e){if(e<1e3)return"".concat(e,"ms");let s=parseFloat((e/1e3).toFixed(2));if(s<60)return"".concat(s,"s");let t=Math.floor(s/60),a=parseFloat((s%60).toFixed(2));return"".concat(t,"m ").concat(a,"s")}function es(e){let{contentType:s}=e,t=s.toLowerCase();return t.includes("html")?(0,a.jsx)(y.A,{className:"h-6 w-6 text-blue-500"}):t.includes("pdf")?(0,a.jsx)(A.A,{className:"h-6 w-6 text-red-500"}):t.includes("json")?(0,a.jsx)(k.A,{className:"h-6 w-6 text-yellow-500"}):t.includes("csv")||t.startsWith("text/plain")?(0,a.jsx)(T.A,{className:"h-6 w-6 text-green-500"}):t.startsWith("text/")?(0,a.jsx)(A.A,{className:"h-6 w-6 text-gray-500"}):(0,a.jsx)(F.A,{className:"h-6 w-6 text-gray-400"})}function et(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Attachment";return e&&"string"==typeof e&&e.split(/[/\\]/).pop()||s}function ea(e){var s,t,c;let{testId:g}=e,N=(0,r.useRouter)(),{currentRun:b,loadingCurrent:T,errorCurrent:P}=(0,l.O)(),[z,H]=(0,d.useState)(null),[V,ea]=(0,d.useState)([]),[er,el]=(0,d.useState)(!0),[en,ei]=(0,d.useState)(null),ed=(0,d.useRef)(null);(0,d.useEffect)(()=>{(null==b?void 0:b.results)&&H(b.results.find(e=>e.id===g)||null)},[b,g]),(0,d.useEffect)(()=>{g&&(async()=>{el(!0),ei(null);try{let e=await B(),s=[];e.forEach(e=>{let t=e.results.find(e=>e.id===g);t&&s.push({date:e.run.timestamp,duration:t.duration,status:t.status})}),s.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),ea(s)}catch(e){console.error("Error fetching test history:",e),ei(e instanceof Error?e.message:"Failed to load test history")}finally{el(!1)}})()},[g]);let ec=(0,d.useMemo)(()=>z&&z.screenshots&&Array.isArray(z.screenshots)?z.screenshots.map((e,s)=>({name:et(e,"Screenshot ".concat(s+1)),path:e,contentType:"image/png","data-ai-hint":"screenshot ".concat(s+1)})):[],[z]),eo=(0,d.useMemo)(()=>z&&z.videoPath&&Array.isArray(z.videoPath)?z.videoPath.map((e,s)=>"string"!=typeof e?(console.warn("Invalid video path element at index ".concat(s,":"),e),{name:"Invalid Video ".concat(s+1),path:"#",contentType:"video/mp4","data-ai-hint":"invalid video"}):{name:et(e,"Video ".concat(s+1)),path:e,contentType:"video/mp4","data-ai-hint":"video ".concat(s+1)}):[],[z]),eh=(0,d.useMemo)(()=>z&&z.tracePath&&"string"==typeof z.tracePath?{name:et(z.tracePath,"trace.zip"),path:z.tracePath,contentType:"application/zip"}:null,[z]),em=(0,d.useMemo)(()=>z&&z.attachments&&Array.isArray(z.attachments)?z.attachments.map((e,s)=>({name:e.name||et(e.path,"Attachment ".concat(s+1)),path:e.path,contentType:e.contentType||"application/octet-stream","data-ai-hint":e["data-ai-hint"]})):[],[z]),eu=(0,d.useMemo)(()=>em.filter(e=>e.contentType.toLowerCase().includes("html")),[em]),ex=(0,d.useMemo)(()=>em.filter(e=>e.contentType.toLowerCase().includes("pdf")),[em]),ep=(0,d.useMemo)(()=>em.filter(e=>e.contentType.toLowerCase().includes("json")),[em]),ej=(0,d.useMemo)(()=>em.filter(e=>e.contentType.toLowerCase().startsWith("text/")),[em]),ef=(0,d.useMemo)(()=>em.filter(e=>!eu.includes(e)&&!ex.includes(e)&&!ep.includes(e)&&!ej.includes(e)),[em,eu,ex,ep,ej]),eg=(0,d.useMemo)(()=>ec.length+eo.length+ +!!eh+em.length,[ec,eo,eh,em]);if(T&&!z)return(0,a.jsxs)("div",{className:"container mx-auto py-8 space-y-6",children:[(0,a.jsx)(p.E,{className:"h-10 w-48 mb-4 rounded-md"}),(0,a.jsxs)(n.Zp,{className:"shadow-xl rounded-lg",children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(p.E,{className:"h-8 w-3/4 mb-2 rounded-md"}),(0,a.jsx)(p.E,{className:"h-4 w-1/2 rounded-md"})]}),(0,a.jsxs)(n.Wu,{className:"space-y-4",children:[(0,a.jsx)(p.E,{className:"h-10 w-1/3 mb-4 rounded-md"}),(0,a.jsx)(p.E,{className:"h-40 w-full rounded-md"})]})]})]});if(P&&!z)return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,a.jsxs)(j.Fc,{variant:"destructive",className:"rounded-lg",children:[(0,a.jsx)(j.XL,{children:"Error loading test data"}),(0,a.jsx)(j.TN,{children:P})]}),(0,a.jsxs)(i.$,{onClick:()=>N.push("/"),variant:"outline",className:"mt-4 rounded-lg",children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4"})," Back"]})]});if(!z)return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8 text-center",children:[(0,a.jsxs)(j.Fc,{className:"rounded-lg",children:[(0,a.jsx)(j.XL,{children:"Test Not Found"}),(0,a.jsxs)(j.TN,{children:["The test with ID '",g,"' could not be found in the current report."]})]}),(0,a.jsxs)(i.$,{onClick:()=>N.push("/"),variant:"outline",className:"mt-6 rounded-lg",children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4"})," Back to Dashboard"]})]});let eN=function(e){if(!e)return"";let s=e.split(" > ");return s[s.length-1]||e}(z.name);return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8 space-y-6",children:[(0,a.jsxs)(i.$,{onClick:()=>N.push("/"),variant:"outline",size:"sm",className:"mb-6 rounded-lg",children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4"})," Back to Dashboard"]}),(0,a.jsxs)(n.Zp,{className:"shadow-xl rounded-lg",children:[(0,a.jsx)(n.aR,{children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(n.ZB,{className:"text-2xl font-headline text-primary flex items-center",title:z.name,children:[(0,a.jsx)(Y,{status:z.status}),(0,a.jsx)("span",{className:"ml-3",children:eN})]}),z.suiteName&&(0,a.jsxs)(n.BT,{className:"mt-1 text-md",children:["From suite: ",z.suiteName]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-2",children:["Latest Run Date: ",T?(0,a.jsx)("span",{className:"text-muted-foreground",children:"Loading..."}):(null==b?void 0:null===(s=b.run)||void 0===s?void 0:s.timestamp)?(0,a.jsx)("span",{className:"font-medium",children:new Date(b.run.timestamp).toLocaleString()}):!P||(null==b?void 0:null===(t=b.run)||void 0===t?void 0:t.timestamp)?(0,a.jsx)("span",{className:"font-medium",children:"Not available"}):(0,a.jsx)("span",{className:"text-destructive font-medium",children:"Error loading date"})]}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(0,a.jsxs)("p",{children:["ID: ",z.id]}),z.browser&&(0,a.jsxs)("p",{children:["Browser: ",z.browser]}),z.codeSnippet&&(0,a.jsxs)("p",{children:["Defined at: ",z.codeSnippet]})]})]}),(0,a.jsxs)("div",{className:"text-right flex-shrink-0",children:[(0,a.jsx)(R.E,{variant:"outline",className:"capitalize text-sm px-3 py-1 rounded-full border",style:function(e){switch(e){case"passed":return{backgroundColor:"hsl(var(--chart-3))",color:"hsl(var(--primary-foreground))"};case"failed":case"timedOut":return{backgroundColor:"hsl(var(--destructive))",color:"hsl(var(--destructive-foreground))"};case"skipped":return{backgroundColor:"hsl(var(--accent))",color:"hsl(var(--accent-foreground))"};case"pending":return{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))"};default:return{backgroundColor:"hsl(var(--muted))",color:"hsl(var(--muted-foreground))"}}}(z.status),children:z.status}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["Duration: ",ee(z.duration)]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Retries: ",z.retries]}),z.tags&&z.tags.length>0&&(0,a.jsx)("div",{className:"mt-1 space-x-1",children:z.tags.map(e=>(0,a.jsx)(R.E,{variant:"secondary",className:"text-xs rounded-full",children:e},e))})]})]})}),(0,a.jsx)(n.Wu,{children:(0,a.jsxs)(h,{defaultValue:"steps",className:"w-full",children:[(0,a.jsxs)(m,{className:"grid w-full grid-cols-2 md:grid-cols-4 mb-4 rounded-lg",children:[(0,a.jsxs)(u,{value:"steps",children:["Execution Steps (",(null===(c=z.steps)||void 0===c?void 0:c.length)||0,")"]}),(0,a.jsxs)(u,{value:"attachments",children:["Attachments (",eg,")"]}),(0,a.jsxs)(u,{value:"logs",children:[(0,a.jsx)(A.A,{className:"h-4 w-4 mr-2"}),"Logs"]}),(0,a.jsx)(u,{value:"history",children:"Test Run History"})]}),(0,a.jsxs)(x,{value:"steps",className:"mt-4 p-1 md:p-4 border rounded-lg bg-card shadow-inner",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-3 px-3 md:px-0",children:"Test Execution Steps"}),z.errorMessage&&(0,a.jsxs)("div",{className:"mb-4 p-3 md:p-0",children:[(0,a.jsx)("h4",{className:"font-semibold text-md text-destructive mb-1",children:"Overall Test Error:"}),(0,a.jsx)("pre",{className:"bg-destructive/10 text-sm p-4 rounded-lg whitespace-pre-wrap break-all font-code overflow-x-auto",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,o.c)(z.errorMessage)}})})]}),z.steps&&z.steps.length>0?(0,a.jsx)(f.F,{className:"h-[600px] w-full",children:(0,a.jsx)("div",{className:"pr-4",children:z.steps.map((e,s)=>(0,a.jsx)(I,{step:e},e.id||s))})}):(0,a.jsx)("p",{className:"text-muted-foreground p-3 md:p-0",children:"No detailed execution steps available for this test."})]}),(0,a.jsx)(x,{value:"attachments",className:"mt-4 p-1 md:p-4 border rounded-lg bg-card shadow-inner",children:(0,a.jsxs)(h,{defaultValue:"sub-screenshots",className:"w-full",children:[(0,a.jsx)(f.F,{className:"w-full whitespace-nowrap rounded-lg",children:(0,a.jsxs)(m,{className:"inline-grid w-max grid-flow-col mb-4 rounded-lg",children:[(0,a.jsxs)(u,{value:"sub-screenshots",disabled:0===ec.length,children:[(0,a.jsx)(L.A,{className:"h-4 w-4 mr-2"}),"Screenshots (",ec.length,")"]}),(0,a.jsxs)(u,{value:"sub-video",disabled:0===eo.length,children:[(0,a.jsx)(D.A,{className:"h-4 w-4 mr-2"}),"Videos (",eo.length,")"]}),(0,a.jsxs)(u,{value:"sub-trace",disabled:!eh,children:[(0,a.jsx)(C.A,{className:"h-4 w-4 mr-2"}),"Trace ",eh?"(1)":"(0)"]}),(0,a.jsxs)(u,{value:"sub-html",disabled:0===eu.length,children:[(0,a.jsx)(y.A,{className:"h-4 w-4 mr-2"}),"HTML (",eu.length,")"]}),(0,a.jsxs)(u,{value:"sub-pdf",disabled:0===ex.length,children:[(0,a.jsx)(A.A,{className:"h-4 w-4 mr-2"}),"PDF (",ex.length,")"]}),(0,a.jsxs)(u,{value:"sub-json",disabled:0===ep.length,children:[(0,a.jsx)(k.A,{className:"h-4 w-4 mr-2"}),"JSON (",ep.length,")"]}),(0,a.jsxs)(u,{value:"sub-text",disabled:0===ej.length,children:[(0,a.jsx)(A.A,{className:"h-4 w-4 mr-2"}),"Text/CSV (",ej.length,")"]}),(0,a.jsxs)(u,{value:"sub-other",disabled:0===ef.length,children:[(0,a.jsx)(F.A,{className:"h-4 w-4 mr-2"}),"Others (",ef.length,")"]})]})}),(0,a.jsxs)(x,{value:"sub-screenshots",className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Screenshots"}),ec.length>0?(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:ec.map((e,s)=>{let t=(0,o.O)(e.path);return"#"===t?null:(0,a.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"relative aspect-video rounded-lg overflow-hidden group border hover:border-primary transition-all shadow-md hover:shadow-lg",children:[(0,a.jsx)(_.default,{src:t,alt:e.name||"Screenshot ".concat(s+1),fill:!0,style:{objectFit:"cover"},className:"group-hover:scale-105 transition-transform duration-300","data-ai-hint":e["data-ai-hint"]||"test screenshot"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center p-2",children:(0,a.jsx)("p",{className:"text-white text-xs text-center break-all",children:e.name||"Screenshot ".concat(s+1)})})]},"img-preview-".concat(s))})}):(0,a.jsx)("p",{className:"text-muted-foreground",children:"No screenshots available for this test."})]}),(0,a.jsxs)(x,{value:"sub-video",className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Video Recording(s)"}),(0,a.jsx)("div",{className:"space-y-4",children:eo.length>0?eo.map((e,s)=>(0,a.jsxs)("div",{className:"p-4 border rounded-lg bg-muted/30 shadow-sm flex items-center justify-between",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-foreground truncate",title:e.name,children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.$,{asChild:!0,variant:"ghost",size:"sm",children:(0,a.jsx)("a",{href:(0,o.O)(e.path),target:"_blank",rel:"noopener noreferrer",children:"View"})}),(0,a.jsx)(i.$,{asChild:!0,variant:"outline",size:"sm",children:(0,a.jsxs)("a",{href:(0,o.O)(e.path),download:e.name,children:[(0,a.jsx)(E.A,{className:"h-4 w-4 mr-2"}),"Download"]})})]})]},"video-".concat(s))):(0,a.jsxs)(j.Fc,{className:"rounded-lg",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),(0,a.jsx)(j.XL,{children:"No Videos Available"}),(0,a.jsx)(j.TN,{children:"There is no video recording associated with this test run."})]})})]}),(0,a.jsxs)(x,{value:"sub-trace",className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Trace File"}),eh?(0,a.jsxs)("div",{className:"p-4 border rounded-lg bg-muted/30 space-y-3 shadow-sm",children:[(0,a.jsxs)("a",{href:(0,o.O)(eh.path),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-primary hover:underline text-base",download:eh.name,children:[(0,a.jsx)(E.A,{className:"h-5 w-5 mr-2"})," Download Trace File (",eh.name,")"]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Path: ",eh.path]}),(0,a.jsxs)(j.Fc,{className:"rounded-lg",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),(0,a.jsx)(j.XL,{children:"Using Trace Files"}),(0,a.jsxs)(j.TN,{children:["Trace files (.zip) can be viewed using the Playwright CLI: ",(0,a.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-sm",children:"npx playwright show-trace /path/to/your/trace.zip"}),". Or by uploading them to ",(0,a.jsx)("a",{href:"https://trace.playwright.dev/",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"trace.playwright.dev"}),"."]})]})]}):(0,a.jsxs)(j.Fc,{className:"rounded-lg",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),(0,a.jsx)(j.XL,{children:"No Trace File Available"}),(0,a.jsx)(j.TN,{children:"There is no Playwright trace file associated with this test run."})]})]}),[{value:"sub-html",title:"HTML Files",attachments:eu},{value:"sub-pdf",title:"PDF Documents",attachments:ex},{value:"sub-json",title:"JSON Files",attachments:ep},{value:"sub-text",title:"Text & CSV Files",attachments:ej},{value:"sub-other",title:"Other Files",attachments:ef}].map(e=>(0,a.jsxs)(x,{value:e.value,className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:e.title}),(0,a.jsx)("div",{className:"space-y-3",children:e.attachments.length>0?e.attachments.map((e,s)=>(0,a.jsxs)("div",{className:"p-3 border rounded-lg bg-muted/30 shadow-sm flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 truncate",children:[(0,a.jsx)(es,{contentType:e.contentType}),(0,a.jsxs)("div",{className:"truncate",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-foreground truncate",title:e.name,children:e.name}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:e.contentType})]})]}),(0,a.jsxs)("div",{className:"flex items-center flex-shrink-0 gap-2",children:[(0,a.jsx)(i.$,{asChild:!0,variant:"ghost",size:"sm",children:(0,a.jsx)("a",{href:(0,o.O)(e.path),target:"_blank",rel:"noopener noreferrer",children:"View"})}),(0,a.jsx)(i.$,{asChild:!0,variant:"outline",size:"sm",children:(0,a.jsxs)("a",{href:(0,o.O)(e.path),download:e.name,children:[(0,a.jsx)(E.A,{className:"h-4 w-4 mr-2"}),"Download"]})})]})]},s)):(0,a.jsxs)(j.Fc,{className:"rounded-lg",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),(0,a.jsx)(j.XL,{children:"No Files Available"}),(0,a.jsx)(j.TN,{children:"No attachments of this type were found for this test."})]})})]},e.value))]})}),(0,a.jsxs)(x,{value:"logs",className:"mt-4 p-4 border rounded-lg bg-card space-y-6 shadow-inner",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-foreground mb-3 flex items-center",children:[(0,a.jsx)(M.A,{className:"h-5 w-5 mr-2 text-primary"}),"Console Logs / Standard Output"]}),(0,a.jsx)(f.F,{className:"h-48 w-full rounded-lg border p-3 bg-muted/30 shadow-sm",children:(0,a.jsx)("pre",{className:"text-sm whitespace-pre-wrap break-words font-code",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,o.c)(z.stdout&&Array.isArray(z.stdout)&&z.stdout.length>0?z.stdout.join("\n"):"No standard output logs captured for this test.")}})})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-foreground mb-3 flex items-center",children:[(0,a.jsx)(v.A,{className:"h-5 w-5 mr-2 text-destructive"}),"Error Messages / Standard Error"]}),(0,a.jsx)(f.F,{className:"h-48 w-full rounded-lg border bg-destructive/5 shadow-sm",children:(0,a.jsx)("pre",{className:"text-sm p-3 whitespace-pre-wrap break-all font-code",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,o.c)(z.errorMessage||"No errors captured for this test.")}})})})]})]}),(0,a.jsxs)(x,{value:"history",className:"mt-4 p-4 border rounded-lg bg-card shadow-inner",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-3",children:(0,a.jsxs)("h3",{className:"text-lg font-semibold text-foreground flex items-center",children:[(0,a.jsx)(O.A,{className:"h-5 w-5 mr-2 text-primary"}),"Individual Test Run History"]})}),er&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(p.E,{className:"h-6 w-3/4 rounded-md"}),(0,a.jsx)(p.E,{className:"h-64 w-full rounded-lg"})]}),en&&!er&&(0,a.jsxs)(j.Fc,{variant:"destructive",className:"rounded-lg",children:[(0,a.jsx)(v.A,{className:"h-4 w-4"}),(0,a.jsx)(j.XL,{children:"Error Loading Test History"}),(0,a.jsx)(j.TN,{children:en})]}),!er&&!en&&0===V.length&&(0,a.jsxs)(j.Fc,{className:"rounded-lg",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),(0,a.jsx)(j.XL,{children:"No Historical Data"}),(0,a.jsxs)(j.TN,{children:["No historical run data found for this specific test (ID: ",g,")."]})]}),!er&&!en&&V.length>0&&(0,a.jsx)("div",{ref:ed,className:"w-full h-[300px] bg-card p-4 rounded-lg shadow-inner",children:(0,a.jsx)(W.u,{width:"100%",height:"100%",children:(0,a.jsxs)(X.b,{data:V,margin:{top:5,right:20,left:-20,bottom:5},children:[(0,a.jsx)($.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(U.W,{dataKey:"date",tickFormatter:e=>new Date(e).toLocaleDateString("en-CA",{month:"short",day:"numeric"}),stroke:"hsl(var(--muted-foreground))",tick:{fontSize:10},angle:-30,textAnchor:"end",height:40}),(0,a.jsx)(Z.h,{tickFormatter:e=>ee(e),stroke:"hsl(var(--muted-foreground))",tick:{fontSize:10},width:80}),(0,a.jsx)(J.m,{content:(0,a.jsx)(Q,{})}),(0,a.jsx)(K.s,{wrapperStyle:{fontSize:"12px"}}),(0,a.jsx)(q.N,{type:"monotone",dataKey:"duration",name:"Duration",stroke:"hsl(var(--primary))",strokeWidth:2,dot:(0,a.jsx)(G,{}),activeDot:{r:7}})]})})})]})]})})]})]})}}},e=>{var s=s=>e(e.s=s);e.O(0,[437,920,220,744,441,684,358],()=>s(25927)),_N_E=e.O()}]);